package com.ikan.positionserver.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.ikan.positionserver.exceldo.PhysicalHostDO;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;

import java.util.List;

@Slf4j
@Data
public class PhysicalHostListener extends AnalysisEventListener<PhysicalHostDO> {
    private List<PhysicalHostDO> physicalHostDOList = Lists.newArrayList();

    @Override
    public void invoke(PhysicalHostDO physicalHostDO, AnalysisContext analysisContext) {
        this.physicalHostDOList.add(physicalHostDO);
    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        log.info("解析物理主机完毕");
    }
}
